package www.wen.com.common.lib.extension

import www.wen.com.common.R
import www.wen.com.common.lib.util.DisplayUtil

/**
 * @author WEN
 * @Description:
 * @date 2021/9/12 15:30
 */

fun Int.verificationText(): String {
    return if (this == 0)
        getString(R.string.get_verification_code)
    else
        "${getString(R.string.reacquire)}${this}s"
}

fun Int.dp():Int = DisplayUtil.dip2px(this.toFloat()).toInt()

fun Int.unread():String {
    return if (this > 99){
        "99+"
    }else{
        "$this"
    }
}